<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions"%>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt"%>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
	<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
<head>
	<title>二手资源交换网</title>
	<link rel="stylesheet" type="text/css" href="<%=path %>/content/images/layout.css" />
</head>
<body>

<div id="main_container">
<jsp:include page="../../header.jsp"></jsp:include>
<div class="center_content">
	<div class="center_left">
        	<jsp:include page="/WEB-INF/notice.jsp"></jsp:include>
         
	<div class="features">   
		<c:choose>
			<c:when test="${pageBean.list == null}">
							没有该学生的货品数据！
					</c:when>
			<c:otherwise>
					<c:forEach items="${pageBean.list}" var="goods">
					<div class="news_box">
	                    <div class="news_icon"><a href="<%=path%>/goods/viewGoods?id=${goods.id }"><img src="<%=path %>/${goods.image.minFileUrl }" width="50"></img></a>
	                    </div>
	                    <div class="goods_name">
	                    	<p><a href="<%=path%>/goods/viewGoods?id=${goods.id }">名称：${goods.name} 数量： ${goods.quantity} 状态：${goods.state == 1? "可交换" :"正常" }</a></p>
	                    </div>
	                    <div class="news_content">
	                    	${fn:substring(fn:replace(goods.content,"<","&lt;"),0,30)}...
	                    </div>   
	                    <div class="goods_time">
	                    	<p>单价：<font color="#FF0000">${goods.value}</font> 发布时间：<fmt:formatDate value="${goods.airTime}" pattern="yyyy-MM-dd HH:mm" /></p>
	                    </div>
	                    
            	    </div>
					</c:forEach>
				<br/>
				<div id="pagecount">
				<p>共  ${pageBean.allRow} 条记录 共 ${pageBean.totalPage} 页 当前第 ${pageBean.currentPage}页</p>
				<c:choose>
					<c:when test="${pageBean.currentPage == 1}">
						<a><span>首页</span></a>
						<a><span>上一页</span></a>
					</c:when>
					<c:otherwise>
						<a onclick="ajaxload(this);return false;" href="<%=path%>/goods/listGoods?page=1"><span>首页</span></a>
						<a onclick="ajaxload(this);return false;" href="<%=path%>/goods/listGoods?page=${pageBean.currentPage-1}"><span>上一页</span></a>
					</c:otherwise>
				</c:choose>
				<c:choose>
					<c:when test="${pageBean.currentPage != pageBean.totalPage}">
						<a onclick="ajaxload(this);return false;" href="<%=path%>/goods/listGoods?page=${pageBean.currentPage+1}"><span>下一页</span></a>
						<a onclick="ajaxload(this);return false;" href="<%=path%>/goods/listGoods?page=${pageBean.totalPage}"><span>尾页</span></a>
					</c:when>
					<c:otherwise>
						<a><span>下一页</span></a>
						<a><span>尾页</span></a>
					</c:otherwise>
				</c:choose>
				</div>
		
			</c:otherwise>
		</c:choose>
		</div>
            
</div> 

<jsp:include page="../../sidebar.jsp"></jsp:include>
<div class="clear"></div> 
</div>
<jsp:include page="../../footer.jsp"></jsp:include>
</div>

</body>
</html>